function myRequest(paramsObj, successFun) {
	let sessionId = uni.getStorageSync('sessionid')

	if (sessionId) {
		paramsObj.header = {
			'content-type': 'application/x-www-form-urlencoded',
			'cookie': 'beegosessionID=' + sessionId
		}
	} else {
		paramsObj.header = {
			'content-type': 'application/x-www-form-urlencoded'
		}
	}
	paramsObj.url = 'https://www.anbanxy.com' + paramsObj.url
	paramsObj.method = 'POST'
	paramsObj.timeout = 5000
	paramsObj.success = successFun
	paramsObj.fail = function() {
		uni.showModal({
			title: '提示',
			content: '网络错误，请求失败'
		})
	}

	uni.request(paramsObj)
}

function showToastMsg(msg = '', success = function(){}) {
	uni.showToast({
		icon: 'none',
		title: msg,
		success: success
	})
}

export {
	myRequest,
	showToastMsg
}
